import request from '@/utils/request'

// 查询主机列表列表
export function listHost(query) {
  return request({
    url: '/devops/host/list',
    method: 'get',
    params: query
  })
}

// 查询主机列表详细
export function getHost(id) {
  return request({
    url: '/devops/host/' + id,
    method: 'get'
  })
}

// 查询主机列表详细
export function getHostDetail(id) {
  return request({
    url: '/devops/host/detail/' + id,
    method: 'get'
  })
}

// 新增主机列表
export function addHost(data) {
  return request({
    url: '/devops/host',
    method: 'post',
    data: data
  })
}

// 修改主机列表
export function updateHost(data) {
  return request({
    url: '/devops/host',
    method: 'put',
    data: data
  })
}

// 删除主机列表
export function delHost(id) {
  return request({
    url: '/devops/host/' + id,
    method: 'delete'
  })
}

// 导出主机列表
export function exportHost(query) {
  return request({
    url: '/devops/host/export',
    method: 'get',
    params: query
  })
}

// 状态修改
export function changeHostStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/devops/host/changeStatus',
    method: 'put',
    data: data
  })
}
